﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using GameObjects;

namespace EquipmentModule.Weapons
{
    public abstract class Weapon : Item
    {
        protected float power;
        protected int bullets;
        protected float reloadTime;
        protected float lastShotTime = 0;
        protected Boolean isShootable = false;
        protected float shootingSpeed = 200.0f;

        public Boolean IsShootable
        {
            get { return isShootable; }
        }

        public Weapon(Vector2 position, Texture2D texture, VampireRider player,
                        float power = 1.0f, int bullets = 10,
                        float reloadTime = 0.5f)
            :base(position, texture, player)
        {
            this.power = power;
            this.bullets = bullets;
            this.reloadTime = reloadTime;
            

        }

        public override void Update(GameTime gametime)
        {
            lastShotTime += gametime.ElapsedGameTime.Milliseconds;

            if (lastShotTime >= reloadTime && bullets > 0)
            {
                isShootable = true;
            }
            else
            {
                isShootable = false;
            }

            base.Update(gametime);

        }

        public override void Use()
        {
        }



    }
}
